<template>
  <div>
    <div class="block">
      <el-carousel trigger="click" height="4rem">
        <el-carousel-item v-for="item in banner" :key="item.index">
          <img :src="item.imgUrl" alt="" width="100%" />
        </el-carousel-item>
      </el-carousel>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      banner: [],
    };
  },
  mounted() {
    this.$http("http://47.108.197.28:4000/api/banner").then((res) => {
      this.banner = res.data.res;
    });
  },
};
</script>

<style scoped>

</style>